package fields;

import model.Board;

public class Brewery extends Ownable {
	private int baseRent;
	
	public Brewery(int number, String name, int price, int baseRent) {
		super(number, name, price);
		this.baseRent = baseRent;
	}

	@Override
	public int getRent() {
		int ownedBreweries = 0;
		for(Field f : this.owner.getOwned()){
			if(f instanceof Brewery) ownedBreweries++;
		}
		return Board.cup.getSum() * this.baseRent * ownedBreweries;
	}

	@Override
	public String toString() {
		return "Brewery\t[" + super.toString() + "]";
	}
}